<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>for循环--杨辉三角</title>
    <style>
      span{
        color: #fff;
      }
    </style>
  </head>
  <body>
    <script>
      function sanjiao(row=5){
        for(let i = 1;i<row;i++){
        for(let n = row-i; n>0;n--){
          document.write(`<span>^</span>`)
        }
        for(let m = i*2-1;m>0;m--){
          document.write("*")
        }
        document.write("<br>")
      }
      }
      sanjiao(40)
    </script>
  </body>
</html>
